
package com.tools.cleanmaster.cpucool.util;

import android.content.Context;

import com.tools.cleanmaster.taskmain.TKPubApi;
import com.tools.cleanmaster.taskmain.ProcessItem;

import java.util.HashMap;
import java.util.List;


public class PhoneAccelerateHelper {

    // 存储单个应用的保护时间 <PackageName, TimeStamp>
    private final static HashMap<String, Long> mAppProtectedMap = new HashMap<String, Long>();


    /**
     * 设置应用的保护时间<br>
     *
     * @param pis
     */
    public static void setAppsProtect(final List<ProcessItem> pis) {
        if (pis != null && pis.size() > 0) {
            for (ProcessItem item : pis) {
                mAppProtectedMap.put(item.pkgName, System.currentTimeMillis());
            }
        }
    }

    public static void executeAccelerateTask(final Context ctx, final List<ProcessItem> pis) {
        if (pis != null && pis.size() > 0) {
            TKPubApi.killProcesses(ctx, pis, null);
        }
    }


}
